<?php 
namespace app\Admin\model;
use think\Model;
use think\Db;

class Cate extends Model
{
	protected $table = 'category';

	/*运用path路径实现无限极分类*/
	public function getPathList($id,$path='path'){
		$result = Db::query("SELECT *,CONCAT($path,'-',$id) as new FROM ".$this->table." ORDER BY new");
		return $result;
	}

	/*添加数据*/
	public function addData($data){
		$result = db("$this->table")->insert($data);
		return $result;
	}

}